﻿<Window x:Class="AttentenceCheckSystem.ApplyOvertimeWorkWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:tableAdapters="clr-namespace:AttentenceCheckSystem.Database1DataSetTableAdapters"
        Title="加班申请与查询" Height="480" Width="640">
    <Window.Resources>
        <ObjectDataProvider x:Key="User"
                            ObjectType="{x:Type tableAdapters:userTableAdapter}"
                            IsAsynchronous="True"
                            MethodName="GetData"
                            />
        <ObjectDataProvider x:Key="OverworkView"
                            ObjectType="{x:Type tableAdapters:加班申请VIEWTableAdapter}"
                            IsAsynchronous="True"
                            MethodName="GetData"/>
    </Window.Resources>
    <StackPanel Orientation="Vertical">
        <Expander Header="加班申请" IsExpanded="True">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="员工姓名:" VerticalAlignment="Center" Margin="10,0,0,0"/>
                <ComboBox Name="staffSelector" DataContext="{Binding Source={StaticResource User}}" ItemsSource="{Binding}"
                          SelectedValuePath="ID" SelectedValue="{Binding Path=ID, Mode=TwoWay}" VerticalAlignment="Center" Margin="5,0,0,0">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=姓名}"/>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <TextBlock Text="加班日期" VerticalAlignment="Center" Margin="10,0,0,0"/>
                <DatePicker Margin="5,0,0,0" Name="OverworkDate"/>
                <Button Content="添加" Margin="10,0,0,0" Width="75" Click="Button_Click" />
            </StackPanel>
        </Expander>
        <Expander Header="加班查询" IsExpanded="True">
            <Grid>
                <DataGrid AutoGenerateColumns="True" Name="dataGrid1" VerticalAlignment="Stretch" ItemsSource="{Binding Source={StaticResource OverworkView}}" AlternatingRowBackground="#FFC6D6FC" GridLinesVisibility="None" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True" />
            </Grid>
        </Expander>
    </StackPanel>
</Window>
